<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE OverloadedStrings #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE NondecreasingIndentation #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      :  Distribution.Simple.Program.Ar</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   :  Duncan Coutts 2009</span><span>
</span><span id="line-10"></span><span class="hs-comment">--</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Maintainer  :  cabal-devel@haskell.org</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- This module provides an library interface to the @ar@ program.</span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Simple.Program.Ar</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-17"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Ar.html#createArLibArchive"><span class="hs-identifier">createArLibArchive</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>    </span><span class="annot"><a href="Distribution.Simple.Program.Run.html#multiStageProgramInvocation"><span class="hs-identifier">multiStageProgramInvocation</span></a></span><span>
</span><span id="line-19"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS</span></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Char8.html#"><span class="hs-identifier">Data.ByteString.Char8</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS8</span></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.CopyFile.html"><span class="hs-identifier">Distribution.Compat.CopyFile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Compat.CopyFile.html#filesEqual"><span class="hs-identifier">filesEqual</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Compiler.html"><span class="hs-identifier">Distribution.Simple.Compiler</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Simple.Compiler.html#arResponseFilesSupported"><span class="hs-identifier">arResponseFilesSupported</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.LocalBuildInfo.html"><span class="hs-identifier">Distribution.Simple.LocalBuildInfo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.LocalBuildInfo.html#LocalBuildInfo"><span class="hs-identifier">LocalBuildInfo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.html"><span class="hs-identifier">Distribution.Simple.Program</span></a></span><span>
</span><span id="line-30"></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Run.html#ProgramInvocation"><span class="hs-identifier">ProgramInvocation</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Builtin.html#arProgram"><span class="hs-identifier">arProgram</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Db.html#requireProgram"><span class="hs-identifier">requireProgram</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.ResponseFile.html"><span class="hs-identifier">Distribution.Simple.Program.ResponseFile</span></a></span><span>
</span><span id="line-32"></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.ResponseFile.html#withResponseFile"><span class="hs-identifier">withResponseFile</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Run.html"><span class="hs-identifier">Distribution.Simple.Program.Run</span></a></span><span>
</span><span id="line-34"></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Run.html#programInvocation"><span class="hs-identifier">programInvocation</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Run.html#multiStageProgramInvocation"><span class="hs-identifier">multiStageProgramInvocation</span></a></span><span>
</span><span id="line-35"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Run.html#runProgramInvocation"><span class="hs-identifier">runProgramInvocation</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Setup.html"><span class="hs-identifier">Distribution.Simple.Setup</span></a></span><span>
</span><span id="line-37"></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Distribution.Simple.Flag.html#fromFlagOrDefault"><span class="hs-identifier">fromFlagOrDefault</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Setup.html#configUseResponseFiles"><span class="hs-identifier">configUseResponseFiles</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html"><span class="hs-identifier">Distribution.Simple.Utils</span></a></span><span>
</span><span id="line-39"></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#defaultTempFileOptions"><span class="hs-identifier">defaultTempFileOptions</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#dieWithLocation%27"><span class="hs-identifier">dieWithLocation'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html#withTempDirectory"><span class="hs-identifier">withTempDirectory</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.System.html"><span class="hs-identifier">Distribution.System</span></a></span><span>
</span><span id="line-41"></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Distribution.System.html#Arch"><span class="hs-identifier">Arch</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.System.html#OS"><span class="hs-identifier">OS</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.System.html#Platform"><span class="hs-identifier">Platform</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html"><span class="hs-identifier">Distribution.Verbosity</span></a></span><span>
</span><span id="line-43"></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier">Verbosity</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#deafening"><span class="hs-identifier">deafening</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#verbose"><span class="hs-identifier">verbose</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier">doesFileExist</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#renameFile"><span class="hs-identifier">renameFile</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator">(&lt;/&gt;)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Windows.html#splitFileName"><span class="hs-identifier">splitFileName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-47"></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier">Handle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.IOMode.html#IOMode"><span class="hs-identifier">IOMode</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.IOMode.html#ReadWriteMode"><span class="hs-identifier">ReadWriteMode</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Device.html#SeekMode"><span class="hs-identifier">SeekMode</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Device.html#AbsoluteSeek"><span class="hs-identifier">AbsoluteSeek</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.html#hFileSize"><span class="hs-identifier">hFileSize</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.html#hSeek"><span class="hs-identifier">hSeek</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#withBinaryFile"><span class="hs-identifier">withBinaryFile</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="hs-comment">-- | Call @ar@ to create a library archive from a bunch of object files.</span><span>
</span><span id="line-51"></span><span class="hs-comment">--</span><span>
</span><span id="line-52"></span><span class="annot"><a href="Distribution.Simple.Program.Ar.html#createArLibArchive"><span class="hs-identifier hs-type">createArLibArchive</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.LocalBuildInfo.html#LocalBuildInfo"><span class="hs-identifier hs-type">LocalBuildInfo</span></a></span><span>
</span><span id="line-53"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span id="createArLibArchive"><span class="annot"><span class="annottext">createArLibArchive :: Verbosity -&gt; LocalBuildInfo -&gt; [Char] -&gt; [[Char]] -&gt; IO ()
</span><a href="Distribution.Simple.Program.Ar.html#createArLibArchive"><span class="hs-identifier hs-var hs-var">createArLibArchive</span></a></span></span><span> </span><span id="local-6989586621679710179"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710179"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679710178"><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679710178"><span class="hs-identifier hs-var">lbi</span></a></span></span><span> </span><span id="local-6989586621679710177"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710177"><span class="hs-identifier hs-var">targetPath</span></a></span></span><span> </span><span id="local-6989586621679710176"><span class="annot"><span class="annottext">[[Char]]
</span><a href="#local-6989586621679710176"><span class="hs-identifier hs-var">files</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-55"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621679710175"><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679710175"><span class="hs-identifier hs-var">ar</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Verbosity
-&gt; Program -&gt; ProgramDb -&gt; IO (ConfiguredProgram, ProgramDb)
</span><a href="Distribution.Simple.Program.Db.html#requireProgram"><span class="hs-identifier hs-var">requireProgram</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710179"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">Program
</span><a href="Distribution.Simple.Program.Builtin.html#arProgram"><span class="hs-identifier hs-var">arProgram</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramDb
</span><a href="#local-6989586621679710174"><span class="hs-identifier hs-var">progDb</span></a></span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679710173"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710173"><span class="hs-identifier hs-var">targetDir</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679710172"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710172"><span class="hs-identifier hs-var">targetName</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ([Char], [Char])
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitFileName"><span class="hs-identifier hs-var">splitFileName</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710177"><span class="hs-identifier hs-var">targetPath</span></a></span><span>
</span><span id="line-58"></span><span>  </span><span class="annot"><span class="annottext">Verbosity -&gt; [Char] -&gt; [Char] -&gt; ([Char] -&gt; IO ()) -&gt; IO ()
forall a. Verbosity -&gt; [Char] -&gt; [Char] -&gt; ([Char] -&gt; IO a) -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#withTempDirectory"><span class="hs-identifier hs-var">withTempDirectory</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710179"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710173"><span class="hs-identifier hs-var">targetDir</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;objs&quot;</span></span><span> </span><span class="annot"><span class="annottext">(([Char] -&gt; IO ()) -&gt; IO ()) -&gt; ([Char] -&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679710171"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710171"><span class="hs-identifier hs-var">tmpDir</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-59"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679710170"><span class="annot"><span class="annottext">tmpPath :: [Char]
</span><a href="#local-6989586621679710170"><span class="hs-identifier hs-var hs-var">tmpPath</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710171"><span class="hs-identifier hs-var">tmpDir</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710172"><span class="hs-identifier hs-var">targetName</span></a></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span>  </span><span class="hs-comment">-- The args to use with &quot;ar&quot; are actually rather subtle and system-dependent.</span><span>
</span><span id="line-62"></span><span>  </span><span class="hs-comment">-- In particular we have the following issues:</span><span>
</span><span id="line-63"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-64"></span><span>  </span><span class="hs-comment">--  -- On OS X, &quot;ar q&quot; does not make an archive index. Archives with no</span><span>
</span><span id="line-65"></span><span>  </span><span class="hs-comment">--     index cannot be used.</span><span>
</span><span id="line-66"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-67"></span><span>  </span><span class="hs-comment">--  -- GNU &quot;ar r&quot; will not let us add duplicate objects, only &quot;ar q&quot; lets us</span><span>
</span><span id="line-68"></span><span>  </span><span class="hs-comment">--     do that. We have duplicates because of modules like &quot;A.M&quot; and &quot;B.M&quot;</span><span>
</span><span id="line-69"></span><span>  </span><span class="hs-comment">--     both make an object file &quot;M.o&quot; and ar does not consider the directory.</span><span>
</span><span id="line-70"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-71"></span><span>  </span><span class="hs-comment">-- Our solution is to use &quot;ar r&quot; in the simple case when one call is enough.</span><span>
</span><span id="line-72"></span><span>  </span><span class="hs-comment">-- When we need to call ar multiple times we use &quot;ar q&quot; and for the last</span><span>
</span><span id="line-73"></span><span>  </span><span class="hs-comment">-- call on OSX we use &quot;ar qs&quot; so that it'll make the index.</span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679710166"><span class="annot"><span class="annottext">simpleArgs :: [[Char]]
</span><a href="#local-6989586621679710166"><span class="hs-identifier hs-var hs-var">simpleArgs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">OS
</span><a href="#local-6989586621679710165"><span class="hs-identifier hs-var">hostOS</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-76"></span><span>             </span><span class="annot"><span class="annottext">OS
</span><a href="Distribution.System.html#OSX"><span class="hs-identifier hs-var">OSX</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;-r&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;-s&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-77"></span><span>             </span><span class="annot"><span class="annottext">OS
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;-r&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span>      </span><span id="local-6989586621679710162"><span class="annot"><span class="annottext">initialArgs :: [[Char]]
</span><a href="#local-6989586621679710162"><span class="hs-identifier hs-var hs-var">initialArgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;-q&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-80"></span><span>      </span><span id="local-6989586621679710158"><span class="annot"><span class="annottext">finalArgs :: [[Char]]
</span><a href="#local-6989586621679710158"><span class="hs-identifier hs-var hs-var">finalArgs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">OS
</span><a href="#local-6989586621679710165"><span class="hs-identifier hs-var">hostOS</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-81"></span><span>             </span><span class="annot"><span class="annottext">OS
</span><a href="Distribution.System.html#OSX"><span class="hs-identifier hs-var">OSX</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;-q&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;-s&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-82"></span><span>             </span><span class="annot"><span class="annottext">OS
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;-q&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-83"></span><span>
</span><span id="line-84"></span><span>      </span><span id="local-6989586621679710155"><span class="annot"><span class="annottext">extraArgs :: [[Char]]
</span><a href="#local-6989586621679710155"><span class="hs-identifier hs-var hs-var">extraArgs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; [[Char]]
forall {a}. IsString a =&gt; Verbosity -&gt; [a]
</span><a href="#local-6989586621679710154"><span class="hs-identifier hs-var">verbosityOpts</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710179"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]] -&gt; [[Char]] -&gt; [[Char]]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710170"><span class="hs-identifier hs-var">tmpPath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span>      </span><span id="local-6989586621679710153"><span class="annot"><span class="annottext">simple :: ProgramInvocation
</span><a href="#local-6989586621679710153"><span class="hs-identifier hs-var hs-var">simple</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram -&gt; [[Char]] -&gt; ProgramInvocation
</span><a href="Distribution.Simple.Program.Run.html#programInvocation"><span class="hs-identifier hs-var">programInvocation</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679710175"><span class="hs-identifier hs-var">ar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[[Char]]
</span><a href="#local-6989586621679710166"><span class="hs-identifier hs-var">simpleArgs</span></a></span><span>  </span><span class="annot"><span class="annottext">[[Char]] -&gt; [[Char]] -&gt; [[Char]]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]]
</span><a href="#local-6989586621679710155"><span class="hs-identifier hs-var">extraArgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-87"></span><span>      </span><span id="local-6989586621679710152"><span class="annot"><span class="annottext">initial :: ProgramInvocation
</span><a href="#local-6989586621679710152"><span class="hs-identifier hs-var hs-var">initial</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram -&gt; [[Char]] -&gt; ProgramInvocation
</span><a href="Distribution.Simple.Program.Run.html#programInvocation"><span class="hs-identifier hs-var">programInvocation</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679710175"><span class="hs-identifier hs-var">ar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[[Char]]
</span><a href="#local-6989586621679710162"><span class="hs-identifier hs-var">initialArgs</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]] -&gt; [[Char]] -&gt; [[Char]]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]]
</span><a href="#local-6989586621679710155"><span class="hs-identifier hs-var">extraArgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-88"></span><span>      </span><span id="local-6989586621679710151"><span class="annot"><span class="annottext">middle :: ProgramInvocation
</span><a href="#local-6989586621679710151"><span class="hs-identifier hs-var hs-var">middle</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ProgramInvocation
</span><a href="#local-6989586621679710152"><span class="hs-identifier hs-var">initial</span></a></span><span>
</span><span id="line-89"></span><span>      </span><span id="local-6989586621679710150"><span class="annot"><span class="annottext">final :: ProgramInvocation
</span><a href="#local-6989586621679710150"><span class="hs-identifier hs-var hs-var">final</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram -&gt; [[Char]] -&gt; ProgramInvocation
</span><a href="Distribution.Simple.Program.Run.html#programInvocation"><span class="hs-identifier hs-var">programInvocation</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679710175"><span class="hs-identifier hs-var">ar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[[Char]]
</span><a href="#local-6989586621679710158"><span class="hs-identifier hs-var">finalArgs</span></a></span><span>   </span><span class="annot"><span class="annottext">[[Char]] -&gt; [[Char]] -&gt; [[Char]]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]]
</span><a href="#local-6989586621679710155"><span class="hs-identifier hs-var">extraArgs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span>      </span><span id="local-6989586621679710149"><span class="annot"><span class="annottext">oldVersionManualOverride :: Bool
</span><a href="#local-6989586621679710149"><span class="hs-identifier hs-var hs-var">oldVersionManualOverride</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-92"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; Flag Bool -&gt; Bool
forall a. a -&gt; Flag a -&gt; a
</span><a href="Distribution.Simple.Flag.html#fromFlagOrDefault"><span class="hs-identifier hs-var">fromFlagOrDefault</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">(Flag Bool -&gt; Bool) -&gt; Flag Bool -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ConfigFlags -&gt; Flag Bool
</span><a href="Distribution.Simple.Setup.html#configUseResponseFiles"><span class="hs-identifier hs-var hs-var">configUseResponseFiles</span></a></span><span> </span><span class="annot"><span class="annottext">(ConfigFlags -&gt; Flag Bool) -&gt; ConfigFlags -&gt; Flag Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; ConfigFlags
</span><a href="Distribution.Types.LocalBuildInfo.html#configFlags"><span class="hs-identifier hs-var hs-var">configFlags</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679710178"><span class="hs-identifier hs-var">lbi</span></a></span><span>
</span><span id="line-93"></span><span>      </span><span id="local-6989586621679710147"><span class="annot"><span class="annottext">responseArgumentsNotSupported :: Bool
</span><a href="#local-6989586621679710147"><span class="hs-identifier hs-var hs-var">responseArgumentsNotSupported</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span>
</span><span id="line-94"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Compiler -&gt; Bool
</span><a href="Distribution.Simple.Compiler.html#arResponseFilesSupported"><span class="hs-identifier hs-var">arResponseFilesSupported</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; Compiler
</span><a href="Distribution.Types.LocalBuildInfo.html#compiler"><span class="hs-identifier hs-var hs-var">compiler</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679710178"><span class="hs-identifier hs-var">lbi</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span>      </span><span class="annot"><a href="#local-6989586621679710144"><span class="hs-identifier hs-type">invokeWithResponesFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Simple.Program.Run.html#ProgramInvocation"><span class="hs-identifier hs-type">ProgramInvocation</span></a></span><span>
</span><span id="line-97"></span><span>      </span><span id="local-6989586621679710144"><span class="annot"><span class="annottext">invokeWithResponesFile :: [Char] -&gt; ProgramInvocation
</span><a href="#local-6989586621679710144"><span class="hs-identifier hs-var hs-var">invokeWithResponesFile</span></a></span></span><span> </span><span id="local-6989586621679710143"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710143"><span class="hs-identifier hs-var">atFile</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-98"></span><span>        </span><span class="annot"><span class="annottext">ConfiguredProgram -&gt; [[Char]] -&gt; ProgramInvocation
</span><a href="Distribution.Simple.Program.Run.html#programInvocation"><span class="hs-identifier hs-var">programInvocation</span></a></span><span> </span><span class="annot"><span class="annottext">ConfiguredProgram
</span><a href="#local-6989586621679710175"><span class="hs-identifier hs-var">ar</span></a></span><span> </span><span class="annot"><span class="annottext">([[Char]] -&gt; ProgramInvocation) -&gt; [[Char]] -&gt; ProgramInvocation
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-99"></span><span>        </span><span class="annot"><span class="annottext">[[Char]]
</span><a href="#local-6989586621679710166"><span class="hs-identifier hs-var">simpleArgs</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]] -&gt; [[Char]] -&gt; [[Char]]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]]
</span><a href="#local-6989586621679710155"><span class="hs-identifier hs-var">extraArgs</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]] -&gt; [[Char]] -&gt; [[Char]]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'@'</span></span><span> </span><span class="annot"><span class="annottext">Char -&gt; [Char] -&gt; [Char]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710143"><span class="hs-identifier hs-var">atFile</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679710149"><span class="hs-identifier hs-var">oldVersionManualOverride</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679710147"><span class="hs-identifier hs-var">responseArgumentsNotSupported</span></a></span><span>
</span><span id="line-102"></span><span>    </span><span class="hs-keyword">then</span><span>
</span><span id="line-103"></span><span>      </span><span class="annot"><span class="annottext">[IO ()] -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Foldable t, Monad m) =&gt;
t (m a) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#sequence_"><span class="hs-identifier hs-var">sequence_</span></a></span><span>
</span><span id="line-104"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; ProgramInvocation -&gt; IO ()
</span><a href="Distribution.Simple.Program.Run.html#runProgramInvocation"><span class="hs-identifier hs-var">runProgramInvocation</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710179"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">ProgramInvocation
</span><a href="#local-6989586621679710140"><span class="hs-identifier hs-var">inv</span></a></span><span>
</span><span id="line-105"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679710140"><span class="annot"><span class="annottext">ProgramInvocation
</span><a href="#local-6989586621679710140"><span class="hs-identifier hs-var">inv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ProgramInvocation
-&gt; (ProgramInvocation, ProgramInvocation, ProgramInvocation)
-&gt; [[Char]]
-&gt; [ProgramInvocation]
</span><a href="Distribution.Simple.Program.Run.html#multiStageProgramInvocation"><span class="hs-identifier hs-var">multiStageProgramInvocation</span></a></span><span>
</span><span id="line-106"></span><span>                   </span><span class="annot"><span class="annottext">ProgramInvocation
</span><a href="#local-6989586621679710153"><span class="hs-identifier hs-var">simple</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ProgramInvocation
</span><a href="#local-6989586621679710152"><span class="hs-identifier hs-var">initial</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ProgramInvocation
</span><a href="#local-6989586621679710151"><span class="hs-identifier hs-var">middle</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ProgramInvocation
</span><a href="#local-6989586621679710150"><span class="hs-identifier hs-var">final</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[[Char]]
</span><a href="#local-6989586621679710176"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-107"></span><span>    </span><span class="hs-keyword">else</span><span>
</span><span id="line-108"></span><span>      </span><span class="annot"><span class="annottext">Verbosity
-&gt; TempFileOptions
-&gt; [Char]
-&gt; [Char]
-&gt; Maybe TextEncoding
-&gt; [[Char]]
-&gt; ([Char] -&gt; IO ())
-&gt; IO ()
forall a.
Verbosity
-&gt; TempFileOptions
-&gt; [Char]
-&gt; [Char]
-&gt; Maybe TextEncoding
-&gt; [[Char]]
-&gt; ([Char] -&gt; IO a)
-&gt; IO a
</span><a href="Distribution.Simple.Program.ResponseFile.html#withResponseFile"><span class="hs-identifier hs-var">withResponseFile</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710179"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">TempFileOptions
</span><a href="Distribution.Simple.Utils.html#defaultTempFileOptions"><span class="hs-identifier hs-var">defaultTempFileOptions</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710171"><span class="hs-identifier hs-var">tmpDir</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;ar.rsp&quot;</span></span><span> </span><span class="annot"><span class="annottext">Maybe TextEncoding
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">[[Char]]
</span><a href="#local-6989586621679710176"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="annot"><span class="annottext">(([Char] -&gt; IO ()) -&gt; IO ()) -&gt; ([Char] -&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-109"></span><span>        </span><span class="hs-glyph">\</span><span id="local-6989586621679710139"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710139"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; ProgramInvocation -&gt; IO ()
</span><a href="Distribution.Simple.Program.Run.html#runProgramInvocation"><span class="hs-identifier hs-var">runProgramInvocation</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710179"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">(ProgramInvocation -&gt; IO ()) -&gt; ProgramInvocation -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; ProgramInvocation
</span><a href="#local-6989586621679710144"><span class="hs-identifier hs-var">invokeWithResponesFile</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710139"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Arch
</span><a href="#local-6989586621679710137"><span class="hs-identifier hs-var">hostArch</span></a></span><span> </span><span class="annot"><span class="annottext">Arch -&gt; Arch -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Arch
</span><a href="Distribution.System.html#Arm"><span class="hs-identifier hs-var">Arm</span></a></span><span> </span><span class="hs-comment">-- See #1537</span><span>
</span><span id="line-112"></span><span>          </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">OS
</span><a href="#local-6989586621679710165"><span class="hs-identifier hs-var">hostOS</span></a></span><span> </span><span class="annot"><span class="annottext">OS -&gt; OS -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">OS
</span><a href="Distribution.System.html#AIX"><span class="hs-identifier hs-var">AIX</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-comment">-- AIX uses its own &quot;ar&quot; format variant</span><span>
</span><span id="line-113"></span><span>    </span><span class="annot"><span class="annottext">Verbosity -&gt; [Char] -&gt; IO ()
</span><a href="Distribution.Simple.Program.Ar.html#wipeMetadata"><span class="hs-identifier hs-var">wipeMetadata</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710179"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710170"><span class="hs-identifier hs-var">tmpPath</span></a></span><span>
</span><span id="line-114"></span><span>  </span><span id="local-6989586621679710133"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679710133"><span class="hs-identifier hs-var">equal</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; IO Bool
</span><a href="Distribution.Compat.CopyFile.html#filesEqual"><span class="hs-identifier hs-var">filesEqual</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710170"><span class="hs-identifier hs-var">tmpPath</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710177"><span class="hs-identifier hs-var">targetPath</span></a></span><span>
</span><span id="line-115"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679710133"><span class="hs-identifier hs-var">equal</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; IO ()
</span><a href="../../directory/src/System.Directory.html#renameFile"><span class="hs-identifier hs-var">renameFile</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710170"><span class="hs-identifier hs-var">tmpPath</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710177"><span class="hs-identifier hs-var">targetPath</span></a></span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-118"></span><span>    </span><span id="local-6989586621679710174"><span class="annot"><span class="annottext">progDb :: ProgramDb
</span><a href="#local-6989586621679710174"><span class="hs-identifier hs-var hs-var">progDb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; ProgramDb
</span><a href="Distribution.Types.LocalBuildInfo.html#withPrograms"><span class="hs-identifier hs-var hs-var">withPrograms</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679710178"><span class="hs-identifier hs-var">lbi</span></a></span><span>
</span><span id="line-119"></span><span>    </span><span class="annot"><a href="Distribution.System.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span id="local-6989586621679710137"><span class="annot"><span class="annottext">Arch
</span><a href="#local-6989586621679710137"><span class="hs-identifier hs-var">hostArch</span></a></span></span><span> </span><span id="local-6989586621679710165"><span class="annot"><span class="annottext">OS
</span><a href="#local-6989586621679710165"><span class="hs-identifier hs-var">hostOS</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo -&gt; Platform
</span><a href="Distribution.Types.LocalBuildInfo.html#hostPlatform"><span class="hs-identifier hs-var hs-var">hostPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">LocalBuildInfo
</span><a href="#local-6989586621679710178"><span class="hs-identifier hs-var">lbi</span></a></span><span>
</span><span id="line-120"></span><span>    </span><span id="local-6989586621679710154"><span class="annot"><span class="annottext">verbosityOpts :: Verbosity -&gt; [a]
</span><a href="#local-6989586621679710154"><span class="hs-identifier hs-var hs-var">verbosityOpts</span></a></span></span><span> </span><span id="local-6989586621679710123"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710123"><span class="hs-identifier hs-var">v</span></a></span></span><span>
</span><span id="line-121"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710123"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Verbosity -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#deafening"><span class="hs-identifier hs-var">deafening</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">a
</span><span class="hs-string">&quot;-v&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-122"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710123"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; Verbosity -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="Distribution.Verbosity.html#verbose"><span class="hs-identifier hs-var">verbose</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-123"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">a
</span><span class="hs-string">&quot;-c&quot;</span></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- Do not warn if library had to be created.</span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-comment">-- | @ar@ by default includes various metadata for each object file in their</span><span>
</span><span id="line-126"></span><span class="hs-comment">-- respective headers, so the output can differ for the same inputs, making</span><span>
</span><span id="line-127"></span><span class="hs-comment">-- it difficult to avoid re-linking. GNU @ar@(1) has a deterministic mode</span><span>
</span><span id="line-128"></span><span class="hs-comment">-- (@-D@) flag that always writes zero for the mtime, UID and GID, and 0644</span><span>
</span><span id="line-129"></span><span class="hs-comment">-- for the file mode. However detecting whether @-D@ is supported seems</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- rather harder than just re-implementing this feature.</span><span>
</span><span id="line-131"></span><span class="annot"><a href="Distribution.Simple.Program.Ar.html#wipeMetadata"><span class="hs-identifier hs-type">wipeMetadata</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Verbosity.html#Verbosity"><span class="hs-identifier hs-type">Verbosity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-132"></span><span id="wipeMetadata"><span class="annot"><span class="annottext">wipeMetadata :: Verbosity -&gt; [Char] -&gt; IO ()
</span><a href="Distribution.Simple.Program.Ar.html#wipeMetadata"><span class="hs-identifier hs-var hs-var">wipeMetadata</span></a></span></span><span> </span><span id="local-6989586621679710122"><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710122"><span class="hs-identifier hs-var">verbosity</span></a></span></span><span> </span><span id="local-6989586621679710121"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710121"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-133"></span><span>    </span><span class="hs-comment">-- Check for existence first (ReadWriteMode would create one otherwise)</span><span>
</span><span id="line-134"></span><span>    </span><span id="local-6989586621679710120"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679710120"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710121"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-135"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679710120"><span class="hs-identifier hs-var">exists</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO ()
forall {a}. [Char] -&gt; IO a
</span><a href="#local-6989586621679710119"><span class="hs-identifier hs-var">wipeError</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Temporary file disappeared&quot;</span></span><span>
</span><span id="line-136"></span><span>    </span><span class="annot"><span class="annottext">[Char] -&gt; IOMode -&gt; (Handle -&gt; IO ()) -&gt; IO ()
forall r. [Char] -&gt; IOMode -&gt; (Handle -&gt; IO r) -&gt; IO r
</span><a href="../../base/src/System.IO.html#withBinaryFile"><span class="hs-identifier hs-var">withBinaryFile</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710121"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">IOMode
</span><a href="../../base/src/GHC.IO.IOMode.html#ReadWriteMode"><span class="hs-identifier hs-var">ReadWriteMode</span></a></span><span> </span><span class="annot"><span class="annottext">((Handle -&gt; IO ()) -&gt; IO ()) -&gt; (Handle -&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679710118"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679710118"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO Integer
</span><a href="../../base/src/GHC.IO.Handle.html#hFileSize"><span class="hs-identifier hs-var">hFileSize</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679710118"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">IO Integer -&gt; (Integer -&gt; IO ()) -&gt; IO ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Handle -&gt; Integer -&gt; IO ()
</span><a href="#local-6989586621679710117"><span class="hs-identifier hs-var">wipeArchive</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679710118"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-139"></span><span>    </span><span id="local-6989586621679710119"><span class="annot"><span class="annottext">wipeError :: [Char] -&gt; IO a
</span><a href="#local-6989586621679710119"><span class="hs-identifier hs-var hs-var">wipeError</span></a></span></span><span> </span><span id="local-6989586621679710114"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710114"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Verbosity -&gt; [Char] -&gt; Maybe Int -&gt; [Char] -&gt; IO a
forall a. Verbosity -&gt; [Char] -&gt; Maybe Int -&gt; [Char] -&gt; IO a
</span><a href="Distribution.Simple.Utils.html#dieWithLocation%27"><span class="hs-identifier hs-var">dieWithLocation'</span></a></span><span> </span><span class="annot"><span class="annottext">Verbosity
</span><a href="#local-6989586621679710122"><span class="hs-identifier hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710121"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Int
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; IO a) -&gt; [Char] -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-140"></span><span>        </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Distribution.Simple.Program.Ar.wipeMetadata: &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710114"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-141"></span><span>    </span><span id="local-6989586621679710111"><span class="annot"><span class="annottext">archLF :: ByteString
</span><a href="#local-6989586621679710111"><span class="hs-identifier hs-var hs-var">archLF</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;!&lt;arch&gt;\x0a&quot;</span></span><span> </span><span class="hs-comment">-- global magic, 8 bytes</span><span>
</span><span id="line-142"></span><span>    </span><span id="local-6989586621679710109"><span class="annot"><span class="annottext">x60LF :: ByteString
</span><a href="#local-6989586621679710109"><span class="hs-identifier hs-var hs-var">x60LF</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;\x60\x0a&quot;</span></span><span> </span><span class="hs-comment">-- header magic, 2 bytes</span><span>
</span><span id="line-143"></span><span>    </span><span id="local-6989586621679710104"><span class="annot"><span class="annottext">metadata :: ByteString
</span><a href="#local-6989586621679710104"><span class="hs-identifier hs-var hs-var">metadata</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#concat"><span class="hs-identifier hs-var">BS.concat</span></a></span><span>
</span><span id="line-144"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;0           &quot;</span></span><span> </span><span class="hs-comment">-- mtime, 12 bytes</span><span>
</span><span id="line-145"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;0     &quot;</span></span><span> </span><span class="hs-comment">-- UID, 6 bytes</span><span>
</span><span id="line-146"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;0     &quot;</span></span><span> </span><span class="hs-comment">-- GID, 6 bytes</span><span>
</span><span id="line-147"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-string">&quot;0644    &quot;</span></span><span> </span><span class="hs-comment">-- mode, 8 bytes</span><span>
</span><span id="line-148"></span><span>        </span><span class="hs-special">]</span><span>
</span><span id="line-149"></span><span>    </span><span class="annot"><a href="#local-6989586621679710102"><span class="hs-identifier hs-type">headerSize</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-150"></span><span>    </span><span id="local-6989586621679710102"><span class="annot"><span class="annottext">headerSize :: Int
</span><a href="#local-6989586621679710102"><span class="hs-identifier hs-var hs-var">headerSize</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">60</span></span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span>    </span><span class="hs-comment">-- http://en.wikipedia.org/wiki/Ar_(Unix)#File_format_details</span><span>
</span><span id="line-153"></span><span>    </span><span class="annot"><a href="#local-6989586621679710117"><span class="hs-identifier hs-type">wipeArchive</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>    </span><span id="local-6989586621679710117"><span class="annot"><span class="annottext">wipeArchive :: Handle -&gt; Integer -&gt; IO ()
</span><a href="#local-6989586621679710117"><span class="hs-identifier hs-var hs-var">wipeArchive</span></a></span></span><span> </span><span id="local-6989586621679710101"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679710101"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span id="local-6989586621679710100"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710100"><span class="hs-identifier hs-var">archiveSize</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-155"></span><span>        </span><span id="local-6989586621679710099"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710099"><span class="hs-identifier hs-var">global</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; Int -&gt; IO ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#hGet"><span class="hs-identifier hs-var">BS.hGet</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679710101"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">BS.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710111"><span class="hs-identifier hs-var">archLF</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710099"><span class="hs-identifier hs-var">global</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710111"><span class="hs-identifier hs-var">archLF</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO ()
forall {a}. [Char] -&gt; IO a
</span><a href="#local-6989586621679710119"><span class="hs-identifier hs-var">wipeError</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Bad global header&quot;</span></span><span>
</span><span id="line-157"></span><span>        </span><span class="annot"><span class="annottext">Integer -&gt; IO ()
</span><a href="#local-6989586621679710096"><span class="hs-identifier hs-var">wipeHeader</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Integer) -&gt; Int -&gt; Integer
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">BS.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710111"><span class="hs-identifier hs-var">archLF</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-160"></span><span>        </span><span class="annot"><a href="#local-6989586621679710096"><span class="hs-identifier hs-type">wipeHeader</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-161"></span><span>        </span><span id="local-6989586621679710096"><span class="annot"><span class="annottext">wipeHeader :: Integer -&gt; IO ()
</span><a href="#local-6989586621679710096"><span class="hs-identifier hs-var hs-var">wipeHeader</span></a></span></span><span> </span><span id="local-6989586621679710095"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710095"><span class="hs-identifier hs-var">offset</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><span class="hs-identifier hs-var">compare</span></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710095"><span class="hs-identifier hs-var">offset</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710100"><span class="hs-identifier hs-var">archiveSize</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-162"></span><span>            </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">EQ</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>            </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">GT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO ()
forall {a}. [Char] -&gt; IO a
</span><a href="#local-6989586621679710119"><span class="hs-identifier hs-var">wipeError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="#local-6989586621679710093"><span class="hs-identifier hs-var">atOffset</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Archive truncated&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span>            </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">LT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-165"></span><span>                </span><span id="local-6989586621679710092"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710092"><span class="hs-identifier hs-var">header</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; Int -&gt; IO ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#hGet"><span class="hs-identifier hs-var">BS.hGet</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679710101"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679710102"><span class="hs-identifier hs-var">headerSize</span></a></span><span>
</span><span id="line-166"></span><span>                </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">BS.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710092"><span class="hs-identifier hs-var">header</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679710102"><span class="hs-identifier hs-var">headerSize</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-167"></span><span>                    </span><span class="annot"><span class="annottext">[Char] -&gt; IO ()
forall {a}. [Char] -&gt; IO a
</span><a href="#local-6989586621679710119"><span class="hs-identifier hs-var">wipeError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="#local-6989586621679710093"><span class="hs-identifier hs-var">atOffset</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Short header&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679710091"><span class="annot"><span class="annottext">magic :: ByteString
</span><a href="#local-6989586621679710091"><span class="hs-identifier hs-var hs-var">magic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#drop"><span class="hs-identifier hs-var">BS.drop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">58</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710092"><span class="hs-identifier hs-var">header</span></a></span><span>
</span><span id="line-169"></span><span>                </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710091"><span class="hs-identifier hs-var">magic</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710109"><span class="hs-identifier hs-var">x60LF</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; ([Char] -&gt; IO ()) -&gt; [Char] -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO ()
forall {a}. [Char] -&gt; IO a
</span><a href="#local-6989586621679710119"><span class="hs-identifier hs-var">wipeError</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; IO ()) -&gt; ([Char] -&gt; [Char]) -&gt; [Char] -&gt; IO ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="#local-6989586621679710093"><span class="hs-identifier hs-var">atOffset</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; IO ()) -&gt; [Char] -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-170"></span><span>                    </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Bad magic &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710091"><span class="hs-identifier hs-var">magic</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot; in header&quot;</span></span><span>
</span><span id="line-171"></span><span>
</span><span id="line-172"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679710087"><span class="annot"><span class="annottext">name :: ByteString
</span><a href="#local-6989586621679710087"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#take"><span class="hs-identifier hs-var">BS.take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">16</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710092"><span class="hs-identifier hs-var">header</span></a></span><span>
</span><span id="line-173"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679710085"><span class="annot"><span class="annottext">size :: ByteString
</span><a href="#local-6989586621679710085"><span class="hs-identifier hs-var hs-var">size</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#take"><span class="hs-identifier hs-var">BS.take</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">10</span></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; ByteString) -&gt; ByteString -&gt; ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#drop"><span class="hs-identifier hs-var">BS.drop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">48</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710092"><span class="hs-identifier hs-var">header</span></a></span><span>
</span><span id="line-174"></span><span>                </span><span id="local-6989586621679710084"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710084"><span class="hs-identifier hs-var">objSize</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ReadS Integer
forall a. Read a =&gt; ReadS a
</span><a href="../../base/src/Text.Read.html#reads"><span class="hs-identifier hs-var">reads</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; [Char]
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#unpack"><span class="hs-identifier hs-var">BS8.unpack</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710085"><span class="hs-identifier hs-var">size</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-175"></span><span>                    </span><span class="hs-special">[</span><span class="hs-special">(</span><span id="local-6989586621679710081"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710081"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679710080"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710080"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; [Char] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../base/src/GHC.Unicode.html#isSpace"><span class="hs-identifier hs-var">isSpace</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710080"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; IO Integer
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710081"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-176"></span><span>                    </span><span class="annot"><span class="annottext">[(Integer, [Char])]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; IO Integer
forall {a}. [Char] -&gt; IO a
</span><a href="#local-6989586621679710119"><span class="hs-identifier hs-var">wipeError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="#local-6989586621679710093"><span class="hs-identifier hs-var">atOffset</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Bad file size in header&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679710077"><span class="annot"><span class="annottext">replacement :: ByteString
</span><a href="#local-6989586621679710077"><span class="hs-identifier hs-var hs-var">replacement</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ByteString] -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#concat"><span class="hs-identifier hs-var">BS.concat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710087"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710104"><span class="hs-identifier hs-var">metadata</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710085"><span class="hs-identifier hs-var">size</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710091"><span class="hs-identifier hs-var">magic</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-179"></span><span>                </span><span class="annot"><span class="annottext">Bool -&gt; IO () -&gt; IO ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">BS.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710077"><span class="hs-identifier hs-var">replacement</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679710102"><span class="hs-identifier hs-var">headerSize</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IO ()) -&gt; IO () -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-180"></span><span>                    </span><span class="annot"><span class="annottext">[Char] -&gt; IO ()
forall {a}. [Char] -&gt; IO a
</span><a href="#local-6989586621679710119"><span class="hs-identifier hs-var">wipeError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; [Char]
</span><a href="#local-6989586621679710093"><span class="hs-identifier hs-var">atOffset</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;Something has gone terribly wrong&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-181"></span><span>                </span><span class="annot"><span class="annottext">Handle -&gt; SeekMode -&gt; Integer -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hSeek"><span class="hs-identifier hs-var">hSeek</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679710101"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">SeekMode
</span><a href="../../base/src/GHC.IO.Device.html#AbsoluteSeek"><span class="hs-identifier hs-var">AbsoluteSeek</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710095"><span class="hs-identifier hs-var">offset</span></a></span><span>
</span><span id="line-182"></span><span>                </span><span class="annot"><span class="annottext">Handle -&gt; ByteString -&gt; IO ()
</span><a href="../../bytestring/src/Data.ByteString.html#hPut"><span class="hs-identifier hs-var">BS.hPut</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679710101"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679710077"><span class="hs-identifier hs-var">replacement</span></a></span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679710067"><span class="annot"><span class="annottext">nextHeader :: Integer
</span><a href="#local-6989586621679710067"><span class="hs-identifier hs-var hs-var">nextHeader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710095"><span class="hs-identifier hs-var">offset</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Integer
forall a. Integral a =&gt; a -&gt; Integer
</span><a href="../../base/src/GHC.Real.html#toInteger"><span class="hs-identifier hs-var">toInteger</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679710102"><span class="hs-identifier hs-var">headerSize</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span>
</span><span id="line-185"></span><span>                        </span><span class="hs-comment">-- Odd objects are padded with an extra '\x0a'</span><span>
</span><span id="line-186"></span><span>                        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Bool
forall a. Integral a =&gt; a -&gt; Bool
</span><a href="../../base/src/GHC.Real.html#odd"><span class="hs-identifier hs-var">odd</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710084"><span class="hs-identifier hs-var">objSize</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710084"><span class="hs-identifier hs-var">objSize</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Integer -&gt; Integer
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">1</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710084"><span class="hs-identifier hs-var">objSize</span></a></span><span>
</span><span id="line-187"></span><span>                </span><span class="annot"><span class="annottext">Handle -&gt; SeekMode -&gt; Integer -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hSeek"><span class="hs-identifier hs-var">hSeek</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679710101"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">SeekMode
</span><a href="../../base/src/GHC.IO.Device.html#AbsoluteSeek"><span class="hs-identifier hs-var">AbsoluteSeek</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710067"><span class="hs-identifier hs-var">nextHeader</span></a></span><span>
</span><span id="line-188"></span><span>                </span><span class="annot"><span class="annottext">Integer -&gt; IO ()
</span><a href="#local-6989586621679710096"><span class="hs-identifier hs-var">wipeHeader</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710067"><span class="hs-identifier hs-var">nextHeader</span></a></span><span>
</span><span id="line-189"></span><span>
</span><span id="line-190"></span><span>          </span><span class="hs-keyword">where</span><span>
</span><span id="line-191"></span><span>            </span><span id="local-6989586621679710093"><span class="annot"><span class="annottext">atOffset :: [Char] -&gt; [Char]
</span><a href="#local-6989586621679710093"><span class="hs-identifier hs-var hs-var">atOffset</span></a></span></span><span> </span><span id="local-6989586621679710060"><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710060"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><a href="#local-6989586621679710060"><span class="hs-identifier hs-var">msg</span></a></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot; at offset &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Integer -&gt; [Char]
forall a. Show a =&gt; a -&gt; [Char]
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679710095"><span class="hs-identifier hs-var">offset</span></a></span><span>
</span><span id="line-192"></span></pre></body></html>